package com.ywk.base.javaBase.ioStream;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamClass {
	public static void main(String[] args) {
		int b= 0;
		FileInputStream in = null;
		FileOutputStream out = null;
		try {
			in = new FileInputStream("E:\\代码编程。。。。\\Java\\my app\\ew\\mydir1\\mydir2\\myfile.java");
			out = new FileOutputStream("E:\\代码编程。。。。\\Java\\my app\\ew\\mydir1\\mydir2\\hw.java");
			while((b = in.read()) != -1){
				out.write(b);
			}
			out.write(b);
			out.close();
		} catch (FileNotFoundException e2) {
			System.out.println("找不到指定文件");System.exit(-1);
		}catch (IOException e1){
			System.out.println("文件复制错误");System.exit(-1);
		}
		System.out.println("文件已复制");
	}

}
